package com.nebula.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.common.collect.Lists;
import com.nebula.common.ServerResponse;
import com.nebula.mapper.UserGroupsMapper;
import com.nebula.pojo.UserGroups;
import com.nebula.service.IUserGroupService;

@Service("userGroupService")
public class UserGroupServiceImpl implements IUserGroupService {
	
	@Autowired
	private UserGroupsMapper userGroupsMapper;
	
	public ServerResponse getUserGroupInfo(){
		List<UserGroups> userGroups = userGroupsMapper.selectUserGroupsInfo();
		List<UserGroups> uGroups = Lists.newArrayList();
		for(UserGroups userGroup : userGroups){
			if(!userGroup.getGroupname().equals("普通用户")){
				uGroups.add(userGroup);
			}
		}
		return ServerResponse.createBySuccess(uGroups);
	}
}

